1. Field of the Invention
The present invention relates to the field of computer systems. More particularly, the present invention relates to a circuit and method for fetching descriptors used in direct memory access data transfers.
2. Description of the Relevant Art
Traditionally, computer systems include subsystems which interface to one another. Communication may include data transfers between memory and an input/output (I/O) device. Data transfers may occur in several ways. For example, in programmed I/O type transfers, all data transfers between memory and I/O devices are completely controlled by the central processing unit (CPU), or more precisely, by a program executed by the CPU. In interrupt I/O type data transfers, all data transfers between memory and I/O devices are initiated by the I/O device through interrupts. In response to I/O interrupts, the CPU suspends whatever it is currently doing and attends to the needs of the I/O device.
A third type of data transfer is known as direct memory access (DMA) data transfer. DMA is a specialized process that transfers data between memory and an I/O device via a direct memory access controller (DMAC), while the CPU continues with other tasks. In other words, all data transfers between memory and the I/O device is accomplished without involving the CPU. The DMA approach speeds overall system speed and generally provides a more efficient way of moving data between the memory and the I/O device.
In DMA transfers, the CPU generates descriptors used by the DMA controllers for transferring data between memory and I/O devices. Descriptors are, in essence, commands to the DMA controllers to transfer data to and from memory. DMA descriptors typically contain fields that identify memory location where data is to be transferred, the number of bits at that memory location to be transferred, and a pointer to a subsequent DMA descriptor. The descriptors are generated by the CPU executing software and temporarily stored in memory. Prior to data transfer, the DMA controllers must retrieve the descriptors from memory. Upon receipt descriptors, DMA controllers initiate data transfer in accordance thereto.
The present invention relates to a circuit and method for prefetching direct memory access descriptors from memory of a computer system. The descriptors are generated by a central processing unit of the computer system executing one or more software applications. In essence, the descriptors are commands that define a data transfer operation between memory and an input/output device. Once the descriptors are generated by the executed software applications, the descriptors are stored in memory for subsequent retrieval by direct memory access controllers.
The present invention prefetches and stores descriptors for a plurality of contexts within a unified memory for subsequent access upon request by the direct memory access controllers. To this end, the method involves reading a plurality of first descriptors from the memory of the computer system. Each of the plurality of first descriptors identifies a first address in the memory where data is to be written via a corresponding first direct memory access controller. A plurality of second descriptors is also read from memory. Each of the plurality of second descriptors identifies a second address in the memory where data is to be read via a corresponding second direct memory access controller. The plurality of first descriptors and the plurality of second descriptors are stored within a unified descriptor memory for subsequent access by the corresponding first and second direct memory access controllers.
The plurality of first descriptors is fetched from memory and stored within the unified descriptor memory in response to the corresponding first direct memory access controller generating a request for one of the plurality of first descriptors. Similarly, the plurality of second descriptors are fetched from memory and stored within the unified descriptor memory in response to the corresponding second direct memory access controller generating a request for one of the plurality of second descriptors.
Subsequent to fetching and storing the plurality of first descriptors and the plurality of second descriptors into the unified descriptor memory, one of the first or second direct memory access controllers may generate an additional request for a descriptor. Upon generation of the additional request, the unified descriptor memory is first checked to determine whether the additionally requested descriptor is contained therein. If the additionally requested descriptor is not contained within the unified descriptor memory, then the additionally requested descriptor is fetched from memory along with a block of other descriptors, and stored within the unified descriptor memory. Subsequent thereto, the additionally requested descriptor is forwarded to the requesting direct memory access controller from the unified descriptor memory.